import React from 'react'
type PropTypes = {
  name: string,
  size?: number,
  color?: string,
  onClick?: any,
  stop?: boolean
}
function Icon(props: PropTypes) {
  return <i 
          className={`iconfont icon-${props.name}`} 
          style={{color: props.color, fontSize: props.size}}
          onClick={
            (e) => {
              props.onClick()
              if (props.stop) {
                e.stopPropagation()
              }
            }
          }
        />
}
Icon.defaultProps = {
  size:16,
  color: '#333',
  onClick: () => {}
}
export default Icon